<?php
namespace App\Repositories\GameServer;

use App\Models\GameServer\Achievement;

class AchievementRepository
{
    //获取所有商品
    public function getAchievements()
    {
        return Achievement::orderBy('listorder', 'desc')->orderBy('id', 'desc')->get();
    }

    public function getAchievement($id)
    {
        return Achievement::find($id);
    }

    public function addAchievement($request)
    {
        $Achievement = Achievement::create($request->all());

        return $Achievement;
    }

    public function updateAchievement($request, $id)
    {
        return Achievement::find($id)->update($request->all());
    }

    public function deleteAchievement($id)
    {
        return Achievement::destroy($id);
    }
}